package scyProject

import (
	"github.com/gin-gonic/gin"
	"likeadmin/clog"
	"likeadmin/dbc"
	"likeadmin/model"
	"likeadmin/sqlop"
	"likeadmin/webu"
	"time"
)

func CreateScyProject(c *gin.Context) {
	scyProject := &model.ScyProject{}
	c.ShouldBind(scyProject)
	scyProject.CreateTime = time.Now().Unix()
	clog.Info("scyProject,CreateScyProject,scyProject=", scyProject)
	err := dbc.DB.Create(scyProject).Error
	webu.GinResult("CreateScyProject Error:", c, err)
}

func UpdateScyProject(c *gin.Context) {
	/*	scyProject := &model.ScyProject{}
		c.ShouldBind(scyProject)
		clog.Info("scyProject,UpdateScyProject,scyProject=", scyProject)
		err := sqlop.ExecFourP("update scy_project set scy_project_name=?,scy_project_introduction=?,update_time=? where id=?", scyProject.ScyProjectName, scyProject.ScyProjectIntroduction, time.Now().Unix(), scyProject.Id)
		webu.GinResult("UpdateScyProject Error:", c, err)*/

}

func DeleteScyProject(c *gin.Context) {
	scyProject := &model.ScyProject{}
	c.ShouldBind(scyProject)
	clog.Info("scyProject,DeleteScyProject,scyProject=", scyProject)
	err := sqlop.ExecTwoP("update scy_project set is_deleted=1,delete_time=? where id=?", time.Now().Unix(), scyProject.Id)
	webu.GinResult("DeleteScyProject Error:", c, err)
}
